home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
sdoor100.zip
/
SDOOR.DOC
< prev
next >
Wrap
Text File
|
1992-03-25
|
19KB
|
551 lines
Simple Door v1.0b
by SumWare Software
Programmer: Roy Hooper
Beta Basher: Rick Chartrand
Documentation : Michelle Chartrand
Simple Door can be registered for $35 Cdn.
Simple Door was written for the use of anyone wishing to make a
door in QuickBasic 4.5. Simple Door's main purpose was to create a
good, easy way to make good doors.
Simple Door is a collection of routines that handle communications
through a FOSSIL driver and manage the user's time limit, and
carrier. There are routines ranging from sending a string to
sending a file, getting a character and getting a string.
Simple Door has many things to make your door look nice, including
only using ANSI routines if the user supports ANSI, and a status bar
with plenty of bits of information on it. The status bar also has a
few controls on it which allow you to chat with the user, and
increase or decrease the user's time. You can shell to DOS, boot
the user out of the door, or even turn off snoop.
Simple Door is multi-node compatible, as it does no disk I/O and
relies on the door file for information on where to do its
communications I/O. If you wish to support multi node, then your
door must support multinode internally.
Simple Door does error handling for any error that might occur
internally. If an error that it cannot handle occurs, then it will
just state it and exit. Simple Door does not do error handling for
your program, only errors internal to Simple Door. If you wish to
learn more about error handling for your program, take a look at ON
ERROR in your QuickBasic 4.5 manual.
- Using Simple Door -
To use Simple Door inside one of your program, you need to include
the SDOOR.BI file. SDOOR.BI can be located in your INCLUDE
directory, or in your QuickBasic program directory, or the current
directory. SDOOR.QLB and SDOOR.LIB has to be located in a place
that QuickBasic can find then when it loads up (usually your
LIBRARY directory or the QuickBasic program directory, or the
current directory).
When loading QuickBasic, you need to tell QuickBasic about the
library. To do this, you need to specify the library on the command
line. Example:
QB /LSDoor
Inside your program, after your DECLARE SUB/FUNCTION lines, if any,
you need to place the following line:
'$INCLUDE: 'SDOOR.BI'
And then you are ready to program with Simple Door. (Don't forget to
initialize Simple Door). One thing to keep in mind is Simple Door
has a 4 minute timeout limit. After 3 minutes 30 seconds of no
keypresses, SDoor warns you with a beep that you have 30 seconds to
do something.
- What Simple Door Can Do -
FUNCTIONS
AColor$ (Fore%, Back%)
Makes an optimized ANSI color string
Fore% = Foreground color to use
Back% = Background color to use
EXAMPLE:
Send AColor$(7,1)+"White on blue"
(q.v. SetColor for a complete list of colors)
CtrlCK% ()
Checks if Control C/K have been checked. Also enables Control C/K
checking. Returns -1 if true, 0 if not true.
EXAMPLE:
IF CtrlCK% THEN
FlushOut
SendCr "Aborted."
END IF
Exist% (FileName$)
Returns a non-zero value if the file exists.
EXAMPLE:
IF Exist%("TEST.TTT") THEN Send "File FOUND"
GetAnsi% ()
Gets the current ANSI setting. Returns -1 if true, 0 if not true.
EXAMPLE:
AnsiMode%=GetAnsi%
IF AnsiMode% THEN
SendCr "Ansi is active"
ELSE
SendCr "Ansi is not active"
END IF
GetBBSName$ ()
Gets the bbs's name, in all uppercase.
EXAMPLE:
Send "This program is registered to : " + GetBbsname$
GetBaudRate& ()
Gets the current baud rate of the user (Door Info). 0 if local.
EXAMPLE:
Send "You are running at" + STR$(GetBaudRate&)
GetCarrier% ()
Gets the current carrier state. Non-zero if there is a carrier.
The user's carrier is automatically managed. This is not really
needed.
EXAMPLE:
IF GetCarrier% THEN Send "YOU ARE STILL CONNECTED"
GetPort% ()
Gets the current serial port setting. -1 if local
EXAMPLE:
Send "You are on com port" + STR$(GetPort%)
GetSecLevel& ()
Gets the user's security level.
EXAMPLE:
Send "Your security Level is" + STR$(GetSecLevel&)
GetSnoopState% ()
Gets the status of the snoop setting on the SysOp's side.
Returns -1 if true, 0 if not.
EXAMPLE:
IF GetSnoopState% THEN
Send "Snoop is ON"
ELSE
Send "Snoop is OFF"
ENDIF
GetSysopName$ ()
Gets the sysop's name, in all uppercase.
EXAMPLE:
Send "Your sysop is: " + GetSysopname$
GetTimeLeft% ()
Gets the amount of time the user has left in minutes.
EXAMPLE:
Send "You have" + STR$(GetTimeLeft%)+" minutes left."
GetUserLocation$ ()
Gets the user's location (DOOR INFO) in all uppercase.
EXAMPLE:
Send "Your location is: " + GetUserLocation$
GetUserName$ ()
Gets the user's name (DOOR INFO) in all uppercase.
EXAMPLE:
Send "Your name is: " + GetUserName$
SUBROUTINES
Center (St$)
Centers the specified text and stays on the same line.
EXAMPLE:
Center "Testing the centering routine"
CenterCr (St$)
Centers the specified text and creates a new line.
EXAMPLE:
CenterCr "Testing the centering routine"
Chat ()
Starts a chat mode with the user. Restores the colors to normal
afterwards.
EXAMPLE:
SendCr "Forced CHAT:"
Chat
ClearScreen ()
Clears the screen
EXAMPLE:
ClearScreen
ComParms (BaudRate&, Flag$)
Sets the communications parameters. These are already set upon
initialization. There should be no need to play with them.
BaudRate& can be: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400
Flag$ takes the form of: "8N1" where the 8 can be replaced by:
5, 6, 7, 8 (Data bits)
and the N can be replaced by:
N, O, E (Parity)
and the 1 can be replaced by:
1, 2 (Stop bits)
EXAMPLE:
ComParms 2400, "8N1"
CtrlCKOn ()
Turns on Control-C/K checking.
EXAMPLE:
CtrlCKOn
CtrlCKOff ()
Turns off Control-C/K checking.
EXAMPLE:
CtrlCKOff
DeInitialize ()
Turns off the status bar and removes it from the screen. Disables
the door driver and turns off the door driver's internal error
checking. Also causes Send, SendCr, and all other routines to
malfunction. DO NOT DO ANY OTHER DOOR DRIVER CALLS AFTER
DE INITIALIZING! DOES NOT TERMINATE THE PROGRAM.
EXAMPLE:
DeInitialize